// components/base/area-picker/index.js
const componentBehavior = require('../../../behaviors/component');
const { COMPONENT_OPTIONS } = require('../../../constants/common');

Component({
    behaviors: [componentBehavior],
    options: {
        ...COMPONENT_OPTIONS,
    },
    properties: {
        show: {
            type: Boolean,
            value: false,
        },
        closeOnClickOverlay: {
            type: Boolean,
            value: true,
        },
        areaList: {
            type: Object,
            value: {},
        },
        value: {
            type: String,
            value: '110000',
        },
        confirmButtonText: {
            type: String,
            value: '确定',
        },
        cancelButtonText: {
            type: String,
            value: '取消',
        },
    },
    methods: {
        handleClose() {
            this.setData({
                show: false,
            });
            // this.triggerEvent('close');
        },
        handleConfirm(e) {
            this.handleClose();
            this.triggerEvent('confirm', e.detail);
        },
    }
})
